home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 31 April 1997
- // Author: cdt
- //
- // Procedure Name:
- // buildCameraToggleMenu
- //
- // Description:
- // Display of menu of toggles for the current camera.
- //
- // Input Arguments:
- // parent - menu name to build menu items for
- // panel - name of panel this menu is associated with
- //
- // Return Value:
- // None.
- //
-
- global proc buildCameraToggleMenu( string $parent, string $panel )
- {
- setParent -m $parent;
-
- // If menu has not been created yet, create it now
- //
- if (`menu -q -numberOfItems $parent` == 0) {
- menuItem -l "Perspective" -checkBox on cameraPerspItem;
- menuItem -l "Journal" -checkBox on cameraJournalItem;
- menuItem -divider true;
-
- radioMenuItemCollection;
- menuItem -l "No Gate" -radioButton on cameraNoGateItem;
- menuItem -l "Film Gate" -radioButton off cameraFileGateItem;
- menuItem -l "Resolution Gate" -radioButton off cameraResGateItem;
- menuItem -divider true;
-
- menuItem -l "Field Chart" -checkBox on cameraFieldChartItem;
- menuItem -l "Safe Action" -checkBox on cameraSafeActionItem;
- menuItem -l "Safe Title" -checkBox on cameraSafeTitleItem;
- menuItem -divider true;
-
- radioMenuItemCollection;
- menuItem -l "Fill" -radioButton on cameraFillItem;
- menuItem -l "Horizontal" -radioButton off cameraHorzItem;
- menuItem -l "Vertical" -radioButton off cameraVertItem;
- menuItem -l "Overscan" -radioButton off cameraOverscanItem;
- }
-
- updateCameraToggleMenu ($parent, $panel);
- }
-
- global proc updateCameraToggleMenu( string $parent, string $panel )
- {
-
- // Update the values in the menu based on the current camera
- //
- string $current = `modelPanel -q -camera $panel`;
- int $isPerspective = !`camera -q -orthographic $current`;
-
- if ($isPerspective) {
- menuItem -edit -checkBox true
- -c ("camera -e -orthographic true "+$current+"; "+
- "updateCameraToggleMenu(\""+$parent+"\",\""+$panel+"\")")
- cameraPerspItem;
- } else {
- menuItem -edit -checkBox false
- -c ("camera -e -orthographic false "+$current+"; "+
- "updateCameraToggleMenu(\""+$parent+"\",\""+$panel+"\")")
- cameraPerspItem;
- }
-
- menuItem -edit -checkBox `camera -q -journalCommand $current`
- -c ("camera -e -journalCommand #1 "+$current) cameraJournalItem;
-
- int $dfg = `camera -q -displayFilmGate $current`;
- int $dr = `camera -q -displayResolution $current`;
- menuItem -edit -radioButton (!$dfg && !$dr) -en $isPerspective
- -c ("camera -e -displayFilmGate off -displayResolution off "+
- "-overscan 1.0 "+$current) cameraNoGateItem;
- menuItem -edit -radioButton $dfg -en $isPerspective
- -c ("camera -e -displayFilmGate on -displayResolution off "+
- "-overscan 1.3 "+$current) cameraFileGateItem;
- menuItem -edit -radioButton $dr -en $isPerspective
- -c ("camera -e -displayFilmGate off -displayResolution on "+
- "-overscan 1.3 "+$current) cameraResGateItem;
-
- int $dfc = `camera -q -displayFieldChart $current`;
- int $dsa = `camera -q -displaySafeAction $current`;
- int $dst = `camera -q -displaySafeTitle $current`;
- string $newState;
-
- if ($dfc == 1) {
- $newState = "off ";
- } else {
- $newState = "on ";
- }
- menuItem -edit -checkBox $dfc -en $isPerspective
- -c ("camera -e -displayFieldChart " + $newState + $current+"; "+
- "updateCameraToggleMenu(\""+$parent+"\",\""+$panel+"\")")
- cameraFieldChartItem;
- if ($dsa == 1) {
- $newState = "off ";
- } else {
- $newState = "on ";
- }
- menuItem -edit -checkBox $dsa -en $isPerspective
- -c ("camera -e -displaySafeAction " + $newState + $current+"; "+
- "updateCameraToggleMenu(\""+$parent+"\",\""+$panel+"\")")
- cameraSafeActionItem;
- if ($dst == 1) {
- $newState = "off ";
- } else {
- $newState = "on ";
- }
- menuItem -edit -checkBox $dst -en $isPerspective
- -c ("camera -e -displaySafeTitle " + $newState + $current+"; "+
- "updateCameraToggleMenu(\""+$parent+"\",\""+$panel+"\")")
- cameraSafeTitleItem;
-
- string $ff = `camera -q -filmFit $current`;
- menuItem -edit -radioButton ($ff == "fill") -en $isPerspective
- -c ("camera -e -filmFit fill "+$current)
- cameraFillItem;
- menuItem -edit -radioButton ($ff == "horizontal")
- -en $isPerspective -c ("camera -e -filmFit horizontal "+$current)
- cameraHorzItem;
- menuItem -edit -radioButton ($ff == "vertical")
- -en $isPerspective -c ("camera -e -filmFit vertical "+$current)
- cameraVertItem;
- menuItem -edit -radioButton ($ff == "overscan")
- -en $isPerspective -c ("camera -e -filmFit overscan "+$current)
- cameraOverscanItem;
- }
-